﻿namespace Prectise03
{
    internal class Program
    {/// <summary>
    /// 汉诺塔问题
    /// </summary>
    /// <param name="args"></param>
        static void Main(string[] args)
        {
            Move(2, "A", "B", "C");
        }
        static void Move(int number,string source,string destination,string other)
        {
            if (number == 1)
            { Console.WriteLine($"move NO.{number}from{source}to{destination}"); }
            else
            {
                Move(number - 1, source, other, destination);
                Console.WriteLine($"move NO.{number}from{source}to{destination}");
                Move(number - 1, other, destination, source);
            }
        }
    }
}
